package cn.schedule.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
@RequestMapping("/game/*")
public class GameController {
    
	  
		/**
		 * 分页查询页面
		 */
		@RequestMapping("findPageList")
		public String findPageList(HttpServletRequest req, HttpServletResponse res, ModelMap model/*, MgtUser mgtUser, Pager page*/) {
			// String sortColumns = "AddTime DESC";// 手动自定排序字段 排序方式
//			mgtUser.setSortColumns("AddTime DESC");
//			Pager pager = mgtUserService.findPageList(mgtUser, page.getPageNumber(), page.getPageSize());
			//获取当前登录用户的userId，用以判断当前操作员不能删除自己
			String currentUserId = (String) req.getSession().getAttribute("mgtUserId");
			model.put("currentUser", currentUserId);
//			model.put("pager", pager);
			return "game/gameList";
		}
		
		/**
		 * 用户详细页
		 */
		@RequestMapping("gameAdd.html")
		public String userDetails(HttpServletRequest req, HttpServletResponse res, ModelMap model/*, MgtUser mgtUser, Pager page*/) {
			// String sortColumns = "AddTime DESC";// 手动自定排序字段 排序方式
//			mgtUser.setSortColumns("AddTime DESC");
//			Pager pager = mgtUserService.findPageList(mgtUser, page.getPageNumber(), page.getPageSize());
			//获取当前登录用户的userId，用以判断当前操作员不能删除自己
			String currentUserId = (String) req.getSession().getAttribute("mgtUserId");
			model.put("currentUser", currentUserId);
//			model.put("pager", pager);
			return "game/gameAdd";
		}
		
}
